import React, {Component} from 'react'
import { Tabs } from 'antd';
import Control from './Control';
const TabPane = Tabs.TabPane;

export default class ListInfo extends React.Component {
    constructor(props) {
        super(props);
        let searchCondition = {loginName: this.props.loginName}
        this.state = {
            searchCondition: searchCondition
        };
    }
    componentWillReceiveProps(nextProps) {
        let searchCondition = {loginName: nextProps.loginName}
        this.setState({
            searchCondition: searchCondition
        });
    }

    render() {
        return (
            <Tabs tabPosition="left" defaultActiveKey="1">
                <TabPane tab="主信息" key="1">Content of Tab 1 loginName:{this.props.loginName}</TabPane>
                <TabPane tab="控制信息" key="2">
                    <Control
                        url = '/base/auth/user/list'
                        searchCondition={this.state.searchCondition}
                    />
                </TabPane>
                <TabPane tab="其他信息" key="3">Content of Tab 3</TabPane>
                <TabPane tab="收货人有效管理" key="4">Content of Tab 1</TabPane>
                <TabPane tab="产品状态规则" key="5">Content of Tab 2</TabPane>
                <TabPane tab="产品多包装" key="6">Content of Tab 3</TabPane>
                <TabPane tab="配件" key="7">Content of Tab 1</TabPane>
            </Tabs>
        );
    }
}
